﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management.master" AutoEventWireup="true"
    CodeFile="new-crm-broker.aspx.cs" Inherits="admin_new_crm_broker" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager runat="server" ID="smgrUser">
    </asp:ScriptManager>
    <div class="contents">
        <table width="100%" cellpadding="3" cellspacing="0" border="0">
            <tr>
                <td colspan="2">
                    <h1>
                        Create / Update CRM Agent</h1>
                    <asp:Label runat="server" ID="lblError" ForeColor="Red" Font-Bold="true" Font-Size="Large"></asp:Label>
                    <asp:Label runat="server" ID="lblMessage" ForeColor="Green" Font-Bold="true" Font-Size="Large"></asp:Label>
                </td>
            </tr>
            <asp:UpdatePanel ID="upnlNewBroker" runat="server">
                <ContentTemplate>
                    <tr>
                        <td width="150">
                            <b>User Role</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:DropDownList ID="ddlUserRole" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlUserRole_SelectedIndexChanged">
                                <asp:ListItem Value="-1" Selected="True">Select</asp:ListItem>
                                <asp:ListItem Value="100">Agent</asp:ListItem>
                                <asp:ListItem Value="200">Admin</asp:ListItem>
                                <asp:ListItem Value="300">Cashier</asp:ListItem>
                                <asp:ListItem Value="201">Admin Temp</asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="rfvUserRole" runat="server" ValidationGroup="customer"
                                Display="Dynamic" InitialValue="-1" ErrorMessage="*" Text="" Font-Bold="true"
                                Font-Size="X-Large" ControlToValidate="ddlUserRole"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="150">
                            <b>Agent</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:DropDownList ID="ddlUser" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlUser_SelectedIndexChanged">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="rfvUSer" runat="server" ValidationGroup="customer"
                                Display="Dynamic" InitialValue="-1" ErrorMessage="*" Text="" Font-Bold="true"
                                Font-Size="X-Large" ControlToValidate="ddlUser"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="150">
                            <b>Email</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:TextBox ID="txtEmail" runat="server" Width="350px" MaxLength="60"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvEmail" runat="server" ValidationGroup="customer"
                                ErrorMessage="*" Text="" Font-Bold="true" Font-Size="X-Large" ControlToValidate="txtEmail"
                                Display="Dynamic"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="revEmail" runat="server" ValidationGroup="customer"
                                ErrorMessage="Invaild Email" Text="" ControlToValidate="txtEmail" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                Display="Dynamic"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="150">
                            <b>Password</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:TextBox ID="txtPassword" runat="server" Width="150px" MaxLength="15" ReadOnly="true"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td width="150">
                            <b>Is Renewal Agent</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:DropDownList ID="ddlRenewal" runat="server">
                                <asp:ListItem Value="0" Selected="True">No</asp:ListItem>
                                <asp:ListItem Value="1">Yes</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td width="150">
                            <b>Campaign</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:DropDownList ID="ddlCampaign" runat="server">
                                <asp:ListItem Value="400" Selected="True">Online</asp:ListItem>
                                <%--<asp:ListItem value="1001">Bank</asp:ListItem>--%>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td width="150">
                            <b>Agent Level</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:DropDownList ID="ddlBrokerLevel" runat="server">
                                <asp:ListItem Value="-1" Selected="True">Select</asp:ListItem>
                                <asp:ListItem Value="ONF">Online Fresher</asp:ListItem>
                                <asp:ListItem Value="ONJ">Online Junior</asp:ListItem>
                                <asp:ListItem Value="ONS">Online Senior</asp:ListItem>
                                <asp:ListItem Value="NOL">No Online Leads</asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="rfvBrokerLevel" runat="server" ValidationGroup="customer"
                                Display="Dynamic" InitialValue="-1" ErrorMessage="*" Text="" Font-Bold="true"
                                Font-Size="X-Large" ControlToValidate="ddlBrokerLevel"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="150">
                            <b>License Number</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:TextBox ID="txtLicenseNumber" runat="server" Width="200px" MaxLength="15"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td width="150">
                            <b>Exten. No. TH</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:Label ID="lblTHContact" runat="server" Text="02-268-8222 ต่อ " Font-Bold="true" ForeColor="Blue"></asp:Label>&nbsp;&nbsp;
                            <asp:TextBox ID="txtTHContact" runat="server" Width="100px" MaxLength="60"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvTHContact" runat="server" ValidationGroup="customer"
                                Display="Dynamic" ErrorMessage="*" Text="" Font-Bold="true" Font-Size="X-Large"
                                ControlToValidate="txtTHContact"></asp:RequiredFieldValidator>
                            &nbsp;&nbsp;<b>Exten. No. EN</b>:&nbsp;&nbsp;
                            <asp:Label ID="lblENContact" runat="server" Text="02-268-8222 ext. " Font-Bold="true" ForeColor="Blue"></asp:Label>&nbsp;&nbsp;
                            <asp:TextBox ID="txtENContact" runat="server" Width="100px" MaxLength="60"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvENContact" runat="server" ValidationGroup="customer"
                                Display="Dynamic" ErrorMessage="*" Text="" Font-Bold="true" Font-Size="X-Large"
                                ControlToValidate="txtENContact"></asp:RequiredFieldValidator>
                            &nbsp;&nbsp;<b>DID Number</b>:&nbsp;&nbsp;
                            <asp:TextBox ID="txtDIDNumber" runat="server" Width="200px" MaxLength="60"></asp:TextBox>
                            <span style='color: #8A0808; font-size: 14px; font-weight: bold;'>&nbsp;&nbsp;"00-000-0000"&nbsp;&nbsp;</span>
                            
                            <asp:RequiredFieldValidator ID="rfvDIDNumber" runat="server" ValidationGroup="customer"
                                Display="Dynamic" ErrorMessage="*" Text="" Font-Bold="true" Font-Size="X-Large"
                                ControlToValidate="txtDIDNumber"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="150">
                            <b>TH First Name</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:TextBox ID="txtTHFirstName" runat="server" Width="200px" MaxLength="60"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvTHFirstName" runat="server" ValidationGroup="customer"
                                Display="Dynamic" ErrorMessage="*" Text="" Font-Bold="true" Font-Size="X-Large"
                                ControlToValidate="txtTHLastName"></asp:RequiredFieldValidator>
                            &nbsp;&nbsp;<b>TH Last Name</b>:&nbsp;&nbsp;
                            <asp:TextBox ID="txtTHLastName" runat="server" Width="200px" MaxLength="60"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvTHLastName" runat="server" ValidationGroup="customer"
                                Display="Dynamic" ErrorMessage="*" Text="" Font-Bold="true" Font-Size="X-Large"
                                ControlToValidate="txtTHLastName"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="150">
                            <b>EN First Name</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:TextBox ID="txtENFirstName" runat="server" Width="200px" MaxLength="60"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvENFirstName" runat="server" ValidationGroup="customer"
                                Display="Dynamic" ErrorMessage="*" Text="" Font-Bold="true" Font-Size="X-Large"
                                ControlToValidate="txtENLastName"></asp:RequiredFieldValidator>
                            &nbsp;&nbsp;<b>EN Last Name</b>:&nbsp;&nbsp;
                            <asp:TextBox ID="txtENLastName" runat="server" Width="200px" MaxLength="60"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvENLastName" runat="server" ValidationGroup="customer"
                                Display="Dynamic" ErrorMessage="*" Text="" Font-Bold="true" Font-Size="X-Large"
                                ControlToValidate="txtENLastName"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="150">
                            <b>Nick Name</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:TextBox ID="txtNickName" runat="server" Width="200px" MaxLength="60"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvNickName" runat="server" ValidationGroup="customer"
                                Display="Dynamic" ErrorMessage="*" Text="" Font-Bold="true" Font-Size="X-Large"
                                ControlToValidate="txtNickName"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="150">
                            <b>DOB</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:DropDownList ID="ddlDay" runat="server">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="rfvDay" runat="server" ValidationGroup="customer"
                                Display="Dynamic" InitialValue="00" ErrorMessage="*" Text="" Font-Bold="true"
                                Font-Size="X-Large" ControlToValidate="ddlDay"></asp:RequiredFieldValidator>
                            <asp:DropDownList ID="ddlMonth" runat="server">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="rfvMonth" runat="server" ValidationGroup="customer"
                                Display="Dynamic" InitialValue="00" ErrorMessage="*" Text="" Font-Bold="true"
                                Font-Size="X-Large" ControlToValidate="ddlMonth"></asp:RequiredFieldValidator>
                            <asp:DropDownList ID="ddlYear" runat="server">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="rfvYear" runat="server" ValidationGroup="customer"
                                Display="Dynamic" InitialValue="0000" ErrorMessage="*" Text="" Font-Bold="true"
                                Font-Size="X-Large" ControlToValidate="ddlYear"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="150">
                            <b>Gender</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:DropDownList ID="ddlGender" runat="server">
                                <asp:ListItem Value="-1" Selected="True">Select</asp:ListItem>
                                <asp:ListItem Value="M">Male</asp:ListItem>
                                <asp:ListItem Value="F">Female</asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="rfvGender" runat="server" ValidationGroup="customer"
                                Display="Dynamic" InitialValue="-1" ErrorMessage="*" Text="" Font-Bold="true"
                                Font-Size="X-Large" ControlToValidate="ddlGender"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="150">
                            <b>Effective From</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:DropDownList ID="ddlEffDay" runat="server">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="rfvEffDay" runat="server" ValidationGroup="customer"
                                Display="Dynamic" InitialValue="00" ErrorMessage="*" Text="" Font-Bold="true"
                                Font-Size="X-Large" ControlToValidate="ddlEffDay"></asp:RequiredFieldValidator>
                            <asp:DropDownList ID="ddlEffMonth" runat="server">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="rfvEffMonth" runat="server" ValidationGroup="customer"
                                Display="Dynamic" InitialValue="00" ErrorMessage="*" Text="" Font-Bold="true"
                                Font-Size="X-Large" ControlToValidate="ddlEffMonth"></asp:RequiredFieldValidator>
                            <asp:DropDownList ID="ddlEffYear" runat="server">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="rfvEffYear" runat="server" ValidationGroup="customer"
                                Display="Dynamic" InitialValue="0000" ErrorMessage="*" Text="" Font-Bold="true"
                                Font-Size="X-Large" ControlToValidate="ddlEffYear"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <%--<tr>
                        <td width="150">
                            <b>Effective Up To</b>
                        </td>
                        <td>
                            :&nbsp;&nbsp;
                            <asp:Label ID="lblEffectiveUpTo" runat="server" Font-Bold="true" Font-Size="Medium"></asp:Label>
                        </td>
                    </tr>--%>
                    <tr>
                        <td colspan="2">
                            <asp:Button ID="btnSubmit" runat="server" Text="Submit" Width="80px" ValidationGroup="customer"
                                OnClick="btnSubmit_Click" />&nbsp;
                            <asp:Button ID="btnClear" runat="server" Text="Clear" Width="80px" OnClick="btnClear_Click" />&nbsp;
                            <asp:Button ID="btnView" runat="server" Text="View" Width="80px" OnClick="btnView_Click" />
                            <div style="display:none;">
                                <asp:TextBox ID="txtAction" runat="server" Text="1"></asp:TextBox>
                                <asp:TextBox ID="txtAgentId" runat="server" Text="0"></asp:TextBox>
                                <asp:TextBox ID="txtProfileId" runat="server" Text="0"></asp:TextBox>
                                <asp:TextBox ID="txtContactId" runat="server" Text="0"></asp:TextBox>
                                <asp:TextBox ID="txtActiveStatus" runat="server" Text="1"></asp:TextBox>
                            </div>
                        </td>
                    </tr>
                </ContentTemplate>
            </asp:UpdatePanel>
        </table>
    </div>
</asp:Content>
